
#include <apvp.pb.h>
#include "PlatformProperty.h"

TRANSMIT_READ_PROPERTY(PA_VINDiffMsg,int32_t) {
    builder.area(VehicleArea::GLOBAL)
        .initValue([](){
                return -1;
        })

        .withStatusBySignals([](const PropertyStatus lastStatus){
                PropertyStatus currentStatus = PropertyStatus::Active;
                auto paData=SIGNAL.getPA_VINDiffMsg();
                if(paData.availability == toInt(sdb::AvailabilitySts::Active)){
                    currentStatus = PropertyStatus::Active;
                }else if(paData.availability == toInt(sdb::AvailabilitySts::NotActive)){
                    currentStatus = PropertyStatus::NotActive;
                }else if(paData.availability == toInt(sdb::AvailabilitySts::NotAvailable)){
                    currentStatus = PropertyStatus::NotAvailable;
                }else if(paData.availability == toInt(sdb::AvailabilitySts::Error)){
                    currentStatus = PropertyStatus::Error;
                }
                return currentStatus;
        },ecarx::transfer::PASignal::PA_VINDiffMsg)

        .withValueBySignals([]([[maybe_unused]] int32_t lastValue){

            auto paData=SIGNAL.getPA_VINDiffMsg();
            return paData.data;


        },ecarx::transfer::PASignal::PA_VINDiffMsg);
}
